feat(experimentation): environment-scoped metrics & experiment results#7674
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Docker builds report
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7674 +/- ##
==========================================
+ Coverage 98.38% 98.54% +0.16%
==========================================
Files 1446 1452 +6
Lines 55321 55711 +390
==========================================
+ Hits 54427 54901 +474
+ Misses 894 810 -84 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|
Visual Regression19 screenshots compared. See report for details. |
86ccf2a to
435d91f
Compare
435d91f to
9568226
Compare
9568226 to
2fea3fa
Compare
… attachment
Add a reusable, environment-scoped Metric and the ExperimentMetric join that
attaches metrics to experiments.
- Models: Metric (numeric; count/sum/mean/occurrence aggregations + JSON
definition), ExperimentMetric (expected_direction; one attach per
experiment+metric); Experiment gains exposure_event ($flag_exposure) and
control_variant.
- Metric library CRUD under environments/{key}/experiment-metrics/, gated on
EXPERIMENT_FLAG + environment admin. Metrics are immutable for now (no
update); deletion blocked while attached to an active experiment.
- Attach/detach metrics under an experiment, with same-environment and
unique-attach validation.
Results computation (ClickHouse query builder + statistics) is intentionally
kept on a separate branch; this branch is models + API only.
2fea3fa to
c961486
Compare
matthewelwell
left a comment
There was a problem hiding this comment.
Approving it based on @gagantrivedi 's approval.
docs/if required so people know about the feature.Changes
Adds an environment-scoped, reusable Metric and the API to attach metrics to experiments. Data-model + API
Metric— env-scoped, soft-delete:name,description,aggregation(count/sum/mean/occurrence), JSONdefinition. Immutable (no update).ExperimentMetric— join withexpected_direction; unique per(experiment, metric).experimental_flags+ env admin):…/environments/{key}/experiment-metrics/— list/create/retrieve/delete (delete blocked409while attached to an active experiment).…/experiments/{id}/metrics/— attach/list/detach, with same-environment + unique-attach validation.How did you test this code?
Unit tests under
api/tests/unit/experimentation/(models, library CRUD, attach/detach, gating, validation). Fullexperimentationsuite green (181 passed);mypy/ruff/flagsmith-lint-testsclean.Manual (flag on, as env admin): create a metric →
201; attach to an experiment →201, re-attach same metric →400;PATCHa metric →405; delete while attached →409, detach then delete →204.